package com.crr.feign;

import com.crr.api.bean.StockDto;
import com.crr.api.feign.SpuRemoteClient;
import com.crr.bean.ResultBean;
import com.crr.controller.BaseController;
import com.crr.service.SpuService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "库存操作")
@RequestMapping("/api")
public class SpuFeignController extends BaseController implements SpuRemoteClient {
    @Autowired
    SpuService spuService;

    @PutMapping("/stock")
    public ResultBean updateStock(List<StockDto> stockDtoList) {
        int i = spuService.updateStock(stockDtoList);
        return updateResult(i);
    }
}
